To ensure security of data transmission, a data device of a sender usually uses an encryption algorithm for encryption, while a data device of a receiver uses a corresponding decryption algorithm to decrypt received data. Classical cryptography may provide a solution for secure transmission of data, but security of the classical cryptography is based on computation complexity, and with rapid advances of computing capability in cloud computing and quantum computing, the classical cryptography has a high risk of being cracked. Quantum cryptography being a cross product of quantum mechanics and cryptography, its security is ensured based on the principle of quantum mechanics (the uncertainty principle of unknown quantum states, the principle of collapse after measurement, and the principle of no-clone), and is unrelated to computing capabilities or storage capabilities of attackers, and thus, can provide secured data transmission. In addition, quantum keys, belonging to matching keys (matching may be interchangeable with being the same in this disclosure), have a low computing cost for performing data encryption and decryption and a relatively high execution efficiency, and thus have become an ideal choice for secured data transmission.
FIG. 1 is a schematic diagram of a quantum key output system in prior art. A basic process of using quantum keys to perform secret transmission of data includes: quantum key distribution devices located at a sender and a receiver negotiating quantum keys through a quantum key distribution protocol, and, in accordance with requirements of key management devices, providing quantum keys stored in the same address range to the corresponding key management devices; the key management devices of the sender and the receiver storing the received quantum keys by using the same address range, and, in accordance with key acquisition requests of corresponding data devices, outputting the quantum keys stored in the same address range to the data devices, and the data device of the sender performing encryption transmission on data to be sent by using an acquired quantum key, and the data device of the receiver decrypting the received data by using the acquired quantum key.
During actual applications, the above-mentioned processing process may have the following problems:
(1) when the quantum keys acquired by the quantum key distribution devices are sent to and written into the corresponding quantum key management devices, due to reasons such as network packet loss or errors occurring in writing of hard drive data, the quantum keys output by the key management devices of the sender and the receiver to the data devices of the sender and the receiver in accordance with the same storage address may be not the same, which is generally referred to as asymmetry or inconsistency, thereby causing the data device of the receiver not to perform a correct decryption operation and the correct original data not be acquired; and
(2) when the number of times for the data devices of the sender and the receiver to acquire inconsistent quantum keys exceeds a preset threshold, the quantum key management devices of the sender and the receiver may need to empty all the acquired quantum keys, for example, by rebooting, which wastes the generated quantum keys.